package com.ptu.controller;

import com.ptu.common.ResponseResult;
import com.ptu.domain.entity.Course;
import com.ptu.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author PTU
 * @since 2023-07-05
 */
@RestController
@RequestMapping("/course")
public class CourseController {

    @Autowired
    private CourseService courseService;

    @GetMapping("/list")
    public ResponseResult<List<Course>> listCourse(){
        List<Course> courseList = courseService.listCourse();
        return ResponseResult.success(courseList);
    }
}
